import { mapGetters } from 'vuex';
export default {
  data () {
    return {
      exportLoading: false,
      pagination: {
        nowPage: 1, // 当前页码
        totalNum: 0, // 总条数
        pageShow: 10 // 当前页码size
      },
      pageSizes: [10, 20, 30, 40] // 页码size options
    }
  },
  computed: {
    ...mapGetters('permissions/systemBtns', ['showBtn']),
    // 接口所需分页入参
    paginationParams () {
      const { nowPage, pageShow } = this.pagination;
      return { nowPage, pageShow };
    }
  },
  methods: {
    // 获取表单内容
    getFormData (data) {
      this.formData = data;
    },
    // 表单查询
    handleQueryForm () {
      this.pagination.nowPage = 1;
      this.getTableData();
    },
    // 页码切换
    handlePageChange (val) {
      this.pagination.nowPage = val;
      this.getTableData();
    },
    // 每页条数切换
    handlePageSizeChange (val) {
      this.pagination.pageShow = val;
      this.getTableData();
    },
    // 设置总页数
    setTotalNum (totalNum) {
      this.pagination.totalNum = totalNum;
    }
  }
}
